package com.open.gen.po;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;

import java.io.Serializable;

/**
 * 自定义元数据的描述类
 */
public class MetaData implements Serializable {

    private static final long serialVersionUID = 1L;

    // 列名
    private String colName;

    // 列类型, 参考java.sql.Types
    private int colType;

    // 列类型名称
    private String colTypeName;

    // 是否是主键
    private boolean isPk;

    // 精确度
    private int precision;

    // 小数点后长度
    private int scale;

    // 映射的属性名
    private String fieldName;

    // 映射的属性名的类型, 如：String
    private String fieldType;

    // 注释
    private String comment;

    public int getColType() {
        return colType;
    }

    public void setColType(int colType) {
        this.colType = colType;
    }

    public String getColTypeName() {
        return colTypeName;
    }

    public void setColTypeName(String colTypeName) {
        this.colTypeName = colTypeName;
    }

    public String getColName() {
        return colName;
    }

    public void setColName(String colName) {
        this.colName = colName;
    }

    public boolean isPk() {
        return isPk;
    }

    public void setPk(boolean isPk) {
        this.isPk = isPk;
    }

    public int getPrecision() {
        return precision;
    }

    public void setPrecision(int precision) {
        this.precision = precision;
    }

    public int getScale() {
        return scale;
    }

    public void setScale(int scale) {
        this.scale = scale;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public String getFieldType() {
        return fieldType;
    }

    public void setFieldType(String fieldType) {
        this.fieldType = fieldType;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    @Override
    public String toString() {
        return ReflectionToStringBuilder.toString(this);
    }
}
